<?php
/**
 * Template Name: Author Page
 *
 * @GramediaWritingProject
 * @version 1.0
 * @Epifana & Vincentia
 */

get_header(); ?>
<?php
    $curauth = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author));
	$authorid= $curauth ->ID;
	$showhide = explode("|",esc_attr(get_the_author_meta( 'showhide', $authorid )));
?>
<div class="row clearfix">
	<div class="col-md-12 column content">
	<div class="row clearfix">
			<?php get_template_part( 'kolompertama2' ); ?>
		
        
		<div class="col-md-9 column" > <!-- untuk kolom kedua yang dibagi 2 -->
			<div class="row clearfix">
				<div class="col-md-8 column">
				<div class="judulceritaterbaru2">Profil Lengkap  </div>
				<?php echo get_wp_user_avatar($authorid, '100'); ?> 
                        <div>
                            <div class="list-group-item" style="border-left:none; border-right:none;">
                                <div class="row">
                                <div class="col-md-3">Nama Lengkap</div>
                                <div class="col-md-8 ">:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $curauth->first_name . " " . $curauth->last_name;?></div>
                                </div>
                            </div>
							 <div class="list-group-item" style="border-left:none; border-right:none;">
                                <div class="row">
                                <div class="col-md-3">Website</div>
                                <div class="col-md-8 ">:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="<?php echo $curauth->user_url; ?>"><?php echo $curauth->user_url; ?></a></div>
                                </div>
                            </div>
							 <div class="list-group-item" style="border-left:none; border-right:none;">
                                <div class="row">
                                <div class="col-md-3">Bio</div>
                                <div class="col-md-8 ">:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $curauth->description; ?></div>
                                </div>
                            </div>
							<?php if ($showhide[0]=="TTLshow"){ ?>
                            <div class="list-group-item" style="border-left:none; border-right:none;">
                                <div class="row">
                                <div class="col-md-3">Tempat / Tanggal Lahir</div>
                                <div class="col-md-8 ">:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo esc_attr(get_the_author_meta( 'tempatlahir', $authorid ))?> / <?php echo esc_attr(get_the_author_meta( 'tanggallahir', $authorid ))?></div>
                                </div>
                            </div><?php }?>
							<?php if ($showhide[1]=="jkshow") { ?>
                            <div class="list-group-item" style="border-left:none; border-right:none;">
                                <div class="row">
                                <div class="col-md-3">Jenis Kelamin</div>
                                <div class="col-md-8 ">:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo esc_attr(get_the_author_meta( 'jk', $authorid ))?></div>
                                </div>
                            </div> <?php }?>
							<?php if ($showhide[2]=="pekerjaanshow") { ?>
                            <div class="list-group-item" style="border-left:none; border-right:none;">
                                <div class="row">
                                <div class="col-md-3">Pekerjaan</div>
                                <div class="col-md-8 ">:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo esc_attr(get_the_author_meta( 'pekerjaan', $authorid ))?></div>
                                </div>
                            </div><?php }?>
							<?php if ($showhide[3]=="notelpshow") { ?>
                            <div class="list-group-item" style="border-left:none; border-right:none;">
                                <div class="row">
                                <div class="col-md-3">No. Telepon</div>
                                <div class="col-md-8 ">:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo esc_attr(get_the_author_meta( 'notelp', $authorid ))?></div>
                                </div>
                            </div><?php }?>
							<?php if ($showhide[4]=="emailshow") { ?>
                            <div class="list-group-item" style="border-left:none; border-right:none;">
                                <div class="row">
                                <div class="col-md-3">Email</div>
                                <div class="col-md-8 ">:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $curauth->user_email;?></div>
                                </div>
                            </div><?php }?>
                           
                                                  
                        </div>
					<br/>
						<div class="judulceritaterbaru2">Semua cerita yang ditulis <?php echo $curauth->first_name . " " . $curauth->last_name;?> :</div>
			
					<?php if ( have_posts() ) :
					{while ( have_posts() ) : the_post(); ?>
					<div class="font10 margin2">
                    	<span class="glyphicon glyphicon-time"></span><?php the_time("l, d F Y");?> - <?php the_ratings();?> <span class="glyphicon glyphicon-comment"></span>&nbsp;<?php comments_number( '0', '1', '% ' );?> | <span class="glyphicon glyphicon-eye-open"></span>&nbsp;<?php the_views()?>
						<br/><a class="fontjudul2" href="<?php the_permalink(); ?>"><?php the_title(); ?> <a/>
						<br/>
						</div>
					
					<?php endwhile;
					wp_pagenavi();
					wp_reset_query();}
					
					else : echo "<strong>".$curauth->first_name . " " . $curauth->last_name . " belum menulis cerita</strong>";
							
					endif;	?>
                </div>
				 <div class="col-md-4 column" style="padding:0; ">
				 <div style="background-color:#f6af97; padding-left:15px; padding-right:15px; padding-bottom:20px; padding-top:1px;">
                	<div class="judulceritaterbaru">Pilihan Editor</div>
                      <?php get_template_part ('pilihaneditor');?>
                    </div>
                          <div class="hr4"></div>
                        <div style="padding-left:15px; padding-right:15px; padding-bottom:20px; padding-top:1px;">
                        <div class="judulceritaterbaru">Terakhir Diperbarui</div>
					<?php //get_template_part('lastmodifiedpost');?>
					<?php get_template_part('lastmodifiedpostscroll')?>
                        </div>
                    
                    </div>
                    </div>
            </div>
		</div>
    </div>
	</div>
	<!-- end untuk content -->
<?php get_footer();?>



